package com.yanqu.road.server.timer.activity;

import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.advertisement.AdvertisementActivityModule;
import com.yanqu.road.server.manger.activity.advertisement.AdvertisementActivityMgr;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.utils.executor.GeneralTask;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.List;

public class AdvertisementCheckResetTask extends GeneralTask {

    protected Logger logger = LogManager.getLogger(AdvertisementCheckResetTask.class.getName());

    public AdvertisementCheckResetTask() {
    }


    @Override
    public void doRun() {
        if (AdvertisementActivityMgr.getActivityInfo() != null){
            List<GamePlayer> playerList = GamePlayerMgr.getCopyPlayerList();
            for(GamePlayer player : playerList){
                player.getModule(AdvertisementActivityModule.class).checkAll();
            }
        }
    }


}
